#include<iostream>
#include<string>
using namespace std;
typedef struct contributor
{
    double number;
    string name;
}ctr;

int main()
{
    int i = 0, frequency = 0;
    cout << "Please enter the number of people who donate: ";
    cin >> frequency;
    cin.get();
    ctr* c = new ctr[frequency];
    for (int i = 0; i < frequency; i++)
    {
        string original;
        switch(i)
        {
            case 0:
            original = "1st";
            break;
            case 1:
            original = "2nd";
            break;
            case 2:
            original = "3rd";
            break;
            case 3:
            original = to_string(i+1) + "th";
            break;
        }
        cout << "Please enter the name of the " << original << " donor: ";
        getline(cin, c[i].name);
        cout << "Please enter the number of donations from the " << original << " donor: ";
        cin >> c[i].number;
        cin.get();
    }
    int n = 1, m = 1;
    cout << "Grand Patrons:" << endl;
    for (int i = 0; i < frequency; i++)
    {
        if (c[i].number > 10000)
        {
            cout << c[i].name << "\t" << c[i].number << endl;
            n = 0;
        }
    }
    if (n)
        cout << "none.\n";
    cout << "Patrons:" << endl;
    for (int i = 0; i < frequency; i++)
    {
        if (c[i].number < 10000)
        {
            cout << c[i].name << "\t" << c[i].number << endl;
            m = 0;
        }
    }
    if (m)
        cout << "none.\n";
    delete[]c;

    return 0;
}